package com.gisocn.onemap.mvp.base;

import android.os.Bundle;
import android.view.View;
import androidx.databinding.ViewDataBinding;
import com.gisocn.onemap.mvp.MvpPresenter;
import com.gisocn.onemap.mvp.MvpView;

/* loaded from: classes.dex */
public abstract class MvpFragment<T extends ViewDataBinding, P extends MvpPresenter> extends BaseFragment<T> implements MvpView {
    private P mPresenter;

    public abstract P createPresenter();

    @Override // com.gisocn.onemap.mvp.base.BaseFragment, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
    }

    @Override // com.gisocn.onemap.mvp.base.BaseFragment, androidx.fragment.app.Fragment
    public void onDestroy() {
        super.onDestroy();
        P p = this.mPresenter;
        if (p != null) {
            p.destroy();
            this.mPresenter = null;
        }
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public P getPresenter() {
        if (this.mPresenter == null) {
            P createPresenter = createPresenter();
            this.mPresenter = createPresenter;
            createPresenter.attachView(this);
        }
        return this.mPresenter;
    }
}
